/**
 * 
 */
package com.yidu.service.emp;

import java.util.Date;
import java.util.List;
import java.util.Map;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.yidu.common.Tools;
import com.yidu.dao.EmpMapper;
import com.yidu.domain.Emp;

/**
 * @author Administrator
 *
 */
@Service
public class EmpServiceImpl implements EmpService{

	@Resource
	private EmpMapper empMapper ;
	
	@Override
	public boolean validateName(String empName) {
		
		return empMapper.findRowCount(empName)>0;
		
	}

	@Override
	public boolean findLogin(Map<String, Object> map) {
		 
		return empMapper.findLogin(map)>0;
	}

	@Override
	public List<Emp> selectAll(Map<String, Object> map) {
		
		return empMapper.selectAll(map);
	}

	@Override
	public int findAllRowCount(Map<String, Object> map) {
		
		return empMapper.findAllRowCount(map);
	}

	@Override
	public List<Emp> selectAll2() {
		
		return empMapper.selectAll2();
	}

	@Override
	public int deleteByPrimaryKey(String empId) {
		 
		return empMapper.deleteByPrimaryKey(empId);
	}

	@Override
	public int insertSelective(Emp emp) {
		
		Date date = Tools.parseDate(emp.getEmpBirthdayStr());
		emp.setEmpBirthday(date);
		return empMapper.insertSelective(emp);
	}

	@Override
	public Emp selectByPrimaryKey(String empId) {
		
		return empMapper.selectByPrimaryKey(empId);
	}

	@Override
	public int updateByPrimaryKeySelective(Emp record) {
		
		return empMapper.updateByPrimaryKeySelective(record);
	}

}
